﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Technoera.Common.Interop.OleDb
{
    public class XlsExportException : ApplicationException
    {
        public XlsExportException(string message) : base(message) { }

        public XlsExportException(XlsExportTask xlsExportTask)
            : base("There was an error while executing export task. See XlsExportTask.ExportLog and inner exception for more information.")
        {
            XlsExportTask = xlsExportTask;
        }

        public XlsExportException(XlsExportTask xlsExportTask, Exception innerException)
            : base("There was an error while executing export task. See XlsExportTask.ExportLog and inner exception for more information.", innerException)
        {
            XlsExportTask = xlsExportTask;
        }

        public XlsExportTask XlsExportTask { get; private set; }

        public override string ToString()
        {
            return string.Concat(XlsExportTask.ExportLog, Environment.NewLine, base.ToString());
        }
    }
}
